﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;

namespace iLangl.Transport.Communication
{
	public class PackagesRobot : BaseTPRobot
	{
		bool isbusy = false;

		public PackagesRobot()
		{
		}

		private static ILog log = LogManager.GetLogger((typeof(PackagesRobot)));
		public PackagesRobot(IRobotGet robotGet, IRobotSet robotset)
		{
			GetOperation = robotGet;
			SetOperation = robotset;
		}


		public override void Execute()
		{
			if (isbusy)
				return;

			isbusy = true;

			try
			{
				base.Execute();
			}
			catch (System.Exception ex)
			{
				log.Error(ex);
				throw ex;
			}
			finally
			{
				isbusy = false;
			}
		}
	}
}
